<?php

namespace addons\oss\library;

use app\common\exception\UploadException;
use app\common\model\Attachment;
use Qiniu\Auth;
use Qiniu\Storage\BucketManager;
use Qiniu\Storage\UploadManager;
use think\Model;
use function Couchbase\defaultDecoder;

class Service
{

    protected $file = '';

    /**
     * @return null
     */
    public function __construct($file = null)
    {
        $this->file = $file;
    }

    /**
     * 阿里云
     * @author: Allen Wu
     * @dateTime: 2022/5/15 13:33
     */
    public function alioss()
    {

    }

    /**
     * 七牛云
     * @return array|void
     * @author: Allen Wu
     * @dateTime: 2022/5/15 13:33
     */
    public function qiniu()
    {
        return (new Qiniu())->upload($this->file);
    }

    /**
     * 删除
     * @param $fileName
     * @author: Allen Wu
     * @dateTime: 2022/5/16 20:12
     */
    public function del($fileName)
    {
        return (new Qiniu())->del($fileName);
    }

}